<%@ page import="java.util.List" %>
<%@ page import="com.autoMobile.bean.Vehicle" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>车辆管理</title>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/styles.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/mrys.css">
</head>
<body>
    <div class="records-container">
        <div class="records-header">
            <h2>车辆管理</h2>
            <div class="filter-bar">
                <button class="btn btn-primary" style="margin-left: 20px;"><a href="<%=request.getContextPath()%>/admin/add_vehicle.jsp">添加车辆</a></button>
            </div>
        </div>

        <div class="table-responsive">
            <table class="table">
                <thead>
                    <tr>
                        <th>车牌号</th>
                        <th>车型</th>
                        <th>状态</th>
                        <th>当前驾驶员</th>
                        <th>购买日期</th>
                        <th>累计里程</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                <c:forEach items="${VehList}" var="Veh" varStatus="ve">
                    <tr>
                        <td>${Veh.licensePlate}</td>
                        <td>${Veh.model}</td>
                        <td><span class="status-tag status-using">${Veh.status}</span></td>
                        <td>${Veh.currentDriver}</td>
                        <td>${Veh.purchaseDate}</td>
                        <td>${Veh.totalMileage} km</td>
                        <td>
                            <button class="btn btn-small btn-secondary"><a href="<%=request.getContextPath()%>/Veh/UpdateVehServlet?in=${ve.index}">编辑</a></button>
                            <button class="btn btn-small btn-secondary"><a href="<%=request.getContextPath()%>/Veh/DeleteVehServlet?id=${Veh.id}">删除</a> </button>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>

    </div>
</body>
</html> 